<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">AngularJS Nice</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">
                <img src="/img/angular-small.png">
                <!--AngularJS Nice-->
            </a>
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li class="<%=locals.current_nav == 'home' ? 'active' : ''%>">
                    <a href="/"><i class="fa fa-home"></i> 首页</a>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle">
                        <i class="fa fa-book"></i> 开发 <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a href="<%=locals.app.baseUrl%>/docs/tutorial">Tutorial</a></li>
                        <li><a href="<%=locals.app.baseUrl%>/docs/guide">Developer Guide</a></li>
                        <li><a href="<%=locals.app.baseUrl%>/docs/api">API Reference</a></li>
                        <li><a href="<%=locals.app.baseUrl%>/docs/error">Error Reference</a></li>
                        <li><a href="<%=locals.app.baseUrl%>/docs/misc/contribute">Contribute</a></li>
                        <li><a href="http://code.angularjs.org/">Download</a></li>
                    </ul>
                </li>
                <li class="<%=locals.current_nav == 'showcase' ? 'active' : ''%>"><a href="<%=locals.app.baseUrl%>/showcase">展示案例</a>
                <li class="<%=locals.current_nav == 'about' ? 'active' : ''%>" ><a href="/about">关于</a>
                </li>
                <%if(locals.isAuthorized){%>
                <li class="<%=locals.current_nav == 'my_posts' ? 'active' : ''%>">
                    <a href="/posts/me">我的文章</a>
                </li>
                <li class="<%=locals.current_nav == 'add_post' ? 'active' : ''%>">
                    <a href="/post/add"><i class="fa fa-plus"></i> 发布文章</a>
                </li>
                <%}%>
            </ul>
            <div class="navbar-form navbar-right">

                <%if(locals.isAuthorized){
                %>
                <div class="btn-group">
                    <a href="javascript:;" class="avatar dropdown-toggle" data-toggle="dropdown">
                        <img id="header_avatar_img" src="<%=locals.user.avatar.path%>" alt="<%=locals.user%>" class="img-circle">
                        <span id="header_user_name" class="avatar-text"><%=locals.user.name%></span>
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu">
                        <!--<li><a href="/">我的主页</a></li>-->
                        <li><a href="/user/account/setting">修改资料</a></li>
                        <li class="divider"></li>
                        <li><a href="/logout">
                            <i class="fa fa-power-off"></i> 退出</a></li>
                    </ul>
                </div>

                <%
                }else{%>
                <a href="/signin" class="btn btn-success <%=locals.current_nav == 'signin' ? 'hide' : ''%>">登录</a>
                <%}%>
            </div>

        </div>
    </div>
</div>